package com.jf.hotelreservation.demos.controller;

import com.jf.hotelreservation.demos.bean.Overview;
import com.jf.hotelreservation.demos.service.OverviewService;
import com.jf.hotelreservation.demos.service.impl.OverviewServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/overview")
public class OverViewController {

    @Autowired
    private OverviewService overviewService;

    @PostMapping("/add")
    public String add(@RequestBody Overview overview){
        return overviewService.addOverview(overview);
    }

    @GetMapping("/queryAll")
    public String queryAll(int currentPage,int pageSize){
        return overviewService.queryAll(currentPage,pageSize);
    }

    @GetMapping("/queryByHotel")
    public String queryByHotel(){
        return overviewService.queryByHotel();
    }
}
